package com.bupt.smart.utils;

/**
 * Created by HH on 2016/5/13.
 * get(url:controller路径，params:传递的参数,responseHandler:回传事件处理)
 * post(url:controller路径，params:传递的参数,responseHandler:回传事件处理)
 * getURL()获取controller完整路径
 */

import com.loopj.android.http.*;
public class MarketHttpClient {

    protected static String url;
    public MarketHttpClient(){
        this.url = "http://118.229.239.36:8080/SmartCommunity/";
    }

    public static String getURL(String end){
        return url+end;
    }
    public static AsyncHttpClient httpclient  = new AsyncHttpClient();
    public static void get(String url,RequestParams params,AsyncHttpResponseHandler responseHandler){
        httpclient.get(getURL(url),params,responseHandler);
    }
    public static  void post(String url,RequestParams params,AsyncHttpResponseHandler responseHandler){
        httpclient.post(getURL(url),params,responseHandler);
    }
}
